set style line 1 lw 3 lt 1
set style line 2 lw 3 lt 2

set key left 
set terminal latex 

unset label
set key top left
#set logscale y
#set logscale x

f(x) = a*x**2

# Problema 1 - Mejor Caso
set output "../../informe/problema1/mejorcaso.tex"
set xlabel "Tamanno de la entrada (n)"
set ylabel "Tiempo (ms)"
set title "Mejor Caso"
fit f(x) "./t1-times-mejor.txt" via a
set label "f(x)=%g*x**2", a at 1,100 
plot "./t1-times-mejor.txt" using 1:2 title "Tiempos del algoritmo", f(x)
#replot f(x)


unset label
set key top left
set logscale y
#set logscale x

f(x) = a*2**(x)*x

# Problema 1 - Peor Caso
set output "../../informe/problema1/peorcaso.tex"
set xlabel "Tamanno de la entrada (n)"
set ylabel "Tiempo (ms)"
set title "Peor Caso"
fit f(x) "./t1-times-peor.txt" via a
#set label "f(x)=%g*2**(x)*x", a at 1,100 
plot "./t1-times-peor.txt" using 1:2 title "Tiempos del algoritmo", f(x)
#replot f(x)

unset label
set key top left

unset logscale y
unset logscale x
set logscale y
#set logscale x

f(x) = 2**(x)*x

# Problema 1 - Caso Aleatorio
set output "../../informe/problema1/casoaleatorio.tex"
set xlabel "Tamanno de la entrada (n)"
set ylabel "Tiempo (ms)"
set title "Caso Aleatorio"
#fit f(x) "./t1-times-aleatorio.txt" via a
#fit g(x) "./t1-times-aleatorio.txt" via b
#set label "f(x)=%g*2**(x)*x", a at 1,100 
plot "./t1-times-aleatorio.txt" using 1:2 title "Tiempos del algoritmo", f(x)
#replot f(x)

unset label
set key top left

unset logscale y
unset logscale x
set logscale y
#set logscale x

# Problema 1 - Comparacion de los difrentes casos
set output "../../informe/problema1/comparacion.tex"
set xlabel "Tamanno de la entrada (n)"
set ylabel "Tiempo (ms)"
set title "Caso Aleatorio"
#fit f(x) "./t1-times-aleatorio.txt" via a
#fit g(x) "./t1-times-aleatorio.txt" via b
#set label "f(x)=%g*2**(x)*x", a at 1,100 
plot [1:30] "./t1-times-aleatorio.txt" using 1:2 title "Casos aleatorios", "./t1-times-mejor.txt" using 1:2 title "Mejores casos", "./t1-times-peor.txt" using 1:2 title "Peores Casos"
#replot f(x)
